package com.example.service.impl;


import com.example.entity.User;
import com.example.mapper.UserMapper;
import com.example.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * com.example.service.impl.UserServiceImpl
 *
 * @author ZRS
 * @version V1.0
 * @since 2025/10/30 20:15
 */
@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAll() {
        return userMapper.findAll();
    }

    @Override
    @Transactional
    public int insert(User user) {
        return userMapper.insert(user);
    }

    @Override
    @Transactional
    public int update(User user) {
        return userMapper.update(user);
    }

    @Override
    @Transactional
    public int delete(Integer id) {
        return userMapper.delete(id);
    }
}
